// components/Regeo-map/Regeo-map.js
var amapFile = require("../SDK/amap-wx.130.js");
Component({

    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        longitude:"",
        latitude:"",
        markers:[]
    },

    /**
     * 组件的方法列表
     */
    methods: {

    },
    lifetimes: {
        attached: function(){
            var that = this;
            var myAmapFun = new amapFile.AMapWX({key:'e3d458b0b0d8c55fa529f4dcb5834643'});
            myAmapFun.getRegeo({
            success: function(data){
                //成功回调
                console.log(data)
                that.setData({
                    latitude : data[0].latitude,
                    longitude : data[0].longitude
                })
            },
            fail: function(info){
                //失败回调
                console.log(info)
            }
            })
        }
    }
})